package com.jvm;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * -Xms600M -Xmx600M
 */
public class OOMTest {

    public static void main(String[] args) throws InterruptedException {
        List<Picture> list = new ArrayList<>();
        while (true){
            Thread.sleep(20);
            list.add(new Picture(new Random().nextInt(1024*1024)));
        }
    }
}

class Picture{
    private byte[] pixles;

    public Picture(int length) {
        this.pixles = new byte[length];
    }
}
